package com.juzi.wopu.query;

import java.util.ArrayList;

public class UserRoleQuery extends LeaderQuery{

	public final static String userRoleSql="(SELECT tSysUser.iId AS userId, "
			+ "tSysUser.sUserNo AS userName,tSysUser.sMobile AS mobile, "
			+ "tSysUserRole.iCompany AS companyId, tSysCode.sName AS companyName,"
			+ "tSysRole.sName AS roleName, tSysRole.iId AS roleId FROM "
			+ "dbo.tSysUser AS tSysUser,dbo.tSysUserRole AS tSysUserRole,"
			+ "dbo.tSysCode AS tSysCode,dbo.tSysRole AS tSysRole "
			+ "where tSysUser.iId = tSysUserRole.iUserId and "
			+ "tSysCode.iId=tSysUserRole.iCompany and "
			+ "tSysRole.iId=tSysUserRole.iRole) AS"; 
	
	public UserRoleQuery() {
		super();
		this.setCountHql(new StringBuilder("select count(*) from "+userRoleSql +" o"));
		this.setLimitHql(new StringBuilder("select * from "+ userRoleSql+" o"));
		this.setWhere(new StringBuilder());
		this.setParamList(new ArrayList<>());
	}
}
